package controller.design_mode_08_response_chain;

/**
 * ***********************************************************
 *
 * @类名 : controller.design_mode_08_response_chain.类名
 * @DESCRIPTION : 这家伙太懒啥都没写
 * @AUTHOR :  一个风情万种的男子
 * @DATE : 2016/4/20
 * ***********************************************************
 */
public class Client {
    public static void main(String[] args) {
        //声明所有的处理节点
        ConHandler1 conHandler1 = new ConHandler1();
        ConHandler2 conHandler2 = new ConHandler2();
        ConHandler3 conHandler3 = new ConHandler3();
        //设置责任链顺序
        conHandler1.setNextHandler(conHandler2);
        conHandler2.setNextHandler(conHandler3);

        //提交请求，返回结果
        MyRequest request = new MyRequest();
        request.setRequestNextLevel(MyLevel.C);
        MyResponse response = conHandler1.handleMessage(request);
        System.out.println("Response:"+response.getCode());

    }
}
